Skip to content

Fix how we invalidate the sbt bridge cache #5050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

smarter
Copy link
Member

@smarter smarter commented Aug 27, 2018

  • Remove the correct files to actually get rid of the cache
  • Only clean the cache when the bridge has been recompiled
  • Make sure the bridge is compiled when compiling a bootstrapped project

- Remove the correct files to actually get rid of the cache
- Only clean the cache when the bridge has been recompiled
- Make sure the bridge is compiled when compiling a bootstrapped project
@smarter smarter requested a review from Duhemm August 27, 2018 18:07
val bridgePattern = s"*dotty-sbt-bridge*$dottyVersion*"

IO.delete((file(home) / ".sbt" / "1.0" / "zinc" / sbtOrg * bridgePattern).get)
IO.delete((file(home) / ".sbt" / "boot" * "scala-*" / sbtOrg / "sbt" * "*" * bridgePattern).get)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How safe is deleting wildcard files under the home directory? Looks a bit scary (both the code and especially that it's allowed). Tho apparently we already did it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paths used are as precise as I can reasonably make them to limit the use of wildcards. Suggestions on making this better are welcome but I think it's fine as is.

Copy link
Contributor

@Duhemm Duhemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm just wondering whether we should invalidate all bootstrapped projects when the bridge gets recompiled? I don't see an easy way to do it, and I'm not even sure it'd be worth it.

@smarter
Copy link
Member Author

smarter commented Aug 28, 2018

Yeah I don't think it's worth it

@smarter
Copy link
Member Author

smarter commented Aug 28, 2018

What would be useful is invalidating bootstrapped projects when the tasty major version is bumped but I don't know how to do that

@smarter smarter merged commit 2e834ea into scala:master Aug 28, 2018
@allanrenucci allanrenucci deleted the fix-cleanSbtBridge branch August 28, 2018 06:33
@jvican
Copy link
Member

jvican commented Aug 28, 2018

FWIW, using Zinc's scripted infrastructure this wouldn't be required, as the compiler bridges are sourced from the classes directory of the sbt projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants